#ifndef RPI_I2C_H
#define RPI_I2C_H
#include <stdint.h>

class rpi_i2c {
public:
    rpi_i2c(const char *d=0,const char a=0,const char r=0);
    ~rpi_i2c();
    void setError(const char *e);
    void setAddress(const char a);
    void setRegister(const char r);
    //void setValue(const char v);
    void setDevice(const char *d);
    
    char* device();
    char address();
    char* error();
    char reg();
    char value();
    void closei2c();
    void setError();
    void write8bit(char w);
    void read8bit(char *r);
    uint16_t read16bitreg(char r);
    uint8_t read8bitreg(char r);
protected:
    char *device_loc;
    char addr_v;
    char register_v;
    char value_v;
    int fd;
    char *buf;
    char *error_str;
};

#endif // BW_SPI_8BIT_H